<%@ page language="java" contentType="text/html; charset=windows-1255"
	pageEncoding="windows-1255"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="mbank.Customer"%>
<%@page import="web.Const"%>
<%@page import="mbank.Account"%>
<%@page import="mbank.ClientActions"%>
<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@page import="mbank.Deposit"%><html>
<head>
<meta http-equiv="Content-Type"
	content="text/html; charset=windows-1255">
<title>Reports</title>
</head>
<body>
<center>
<%
	Customer customer = (Customer) session.getAttribute(Const.CUSTOMER);
	Account account = (Account) session.getAttribute(Const.ACCOUNT);
	ClientActions clientActions = (ClientActions) session
			.getAttribute(Const.CLIENT_ACTIONS);

	List listDeposits = clientActions.getListDepositsByCust_id(customer
			.getCustId());

	long sumDepositAmount = 0;

	for (int i = 0; i < listDeposits.size(); i++) {
		Deposit deposit = ((Deposit) listDeposits.get(i));

		sumDepositAmount += deposit.getAmount();
	}
%>
<h1>Reports</h1>
<br>
<br>
<table>
	<tr>
		<td><u>Amount of money:</u>
		<table border="0">
			<br>
			<tr align="left">
				<td><b>Type</b></td>
				<td><b>Sum</b></td>
			</tr>
			<tr>
				<td><i>Deposits</i></td>
				<td><%=sumDepositAmount%></td>
			</tr>
			<tr align="left">
				<td><i>Account</i></td>
				<td><%=account.getAmount()%></td>
			</tr>
			<tr align="left">
				<td><i>Sum</i></td>
				<td><%=(account.getAmount() + sumDepositAmount)%></td>
			</tr>
		</table>
		</td>
	</tr>
</table>

</center>
</body>
</html>